<?php
header("Content-Type: application/octet-stream");     
$a=$_GET['name'];

$ua = $_SERVER["HTTP_USER_AGENT"];    
$filename = "config.ini";    
$encoded_filename = urlencode($filename);    
$encoded_filename = str_replace("+", "%20", $encoded_filename);    

if (preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']) ) {      
    header('Content-Disposition:  attachment; filename="' . $encoded_filename . '"');      
} elseif (preg_match("/Firefox/", $_SERVER['HTTP_USER_AGENT'])) {      
    header('Content-Disposition: attachment; filename*="utf8' .  $filename . '"');      
} else {      
    header('Content-Disposition: attachment; filename="' .  $filename . '"');      
}  

$myfile = fopen("test.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("test.txt"));
fclose($myfile);

?>